@extends('admin.master')
<script src="/js/admin/deviceList.js"></script>

@section('title', '设备列表')
@section('firstItem')
@parent
				<span>设备列表</span>
				<input class="a_indexbg" type="hidden" value="devicelist" />
				<input class="typeId" type="hidden" value="{{ $type_id or '' }}" >
@stop
@section('searchList')
@parent
				<a class="aaa">搜索</a>
				<div>水机状态		
					<input type="text" class="deviceCheckBox deviceStatusCheckBox" value="{{ $status or '' }}" placeholder="选择水机状态" />
					<div class="deviceCheckDropBox deviceStatusCheckDropBox">
						<a>全部</a>
						<a>检修</a>
						<a>缺水</a>
					</div>
				</div>
				<div>设备型号
					<div class="deviceCheckDropBox deviceModelDropBox">
						<a><input type="hidden" value="" /><span>全部</span></a>
						@foreach($device_types as $type)
						<a><input type="hidden" value="{{ $type->id }}" /><span>{{ $type->type }}</span></a>
							@if($type->id == $type_id)
								<?php $type_name = $type->type ?>
							@endif
						@endforeach
					</div>
					<input type="text" class="deviceCheckBox deviceModelBox" placeholder="选择设备型号" value="{{ $type_name or '' }}" />
				</div>
				<div>设备编号 <input class="deviceCodeBox" type="text" value="{{ $device_code or '' }}" placeholder="输入设备编号" />
				</div>	
@stop
@section('dataTables')
@parent
			<table class="dataTable dataTables" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<td>序号</td>
						<td>设备编号</td>
						<td>设备型号</td>
						<td>滤芯1</td>
						<td>滤芯2</td>
						<td>滤芯3</td>
						<td>滤芯4</td>
						<td>滤芯5</td>
						<td>纯水ppm</td>
						<td>水机状态</td>
						<td>绑定用户</td>
						<td>记录时间</td>
					</tr>
				</thead>
				<tbody>
					@for($i=0, $deviceCount=count($device_list); $i<$deviceCount; $i++)
					<tr >
						<td><input type="hidden" value="{{ $device_list[$i]->device_id }}" />{{ $i+1 }}</td>
						<td class="deviceCodeCell devicecodeVal"><a href="/admin/device/history?device_id={{ $device_list[$i]->device_id }}">{{ $device_list[$i]->device->code }}</a></td>
						<td class="deviceModelCell">{{ $device_list[$i]->device->deviceType->type }}</td>
						<td class="filterWidth">{{ $device_list[$i]->filter1 }}%</td>
						<td class="filterWidth">{{ $device_list[$i]->filter2 }}%</td>
						<td class="filterWidth">{{ $device_list[$i]->filter3 }}%</td>
						<td class="filterWidth">{{ $device_list[$i]->filter4 }}%</td>
						<td class="filterWidth">
							@if($device_list[$i]->device->deviceType->type == 'H5')
								/
							@else
								{{ $device_list[$i]->filter5 }}%
							@endif
						</td>
						<td class="ppmNum">{{ $device_list[$i]->TDS2 }}</td>
						@if($device_list[$i]->dec_status == 2)
						<td class="lessWaterBg">
							@elseif($device_list[$i]->dec_status == 4)
						<td class="serviceBg">
						@else
						<td>
						@endif
						{{ $device_list[$i]->device_status_description }}</td>
						<td class="bindUser">
						@for($j=0,$userCount=count($device_list[$i]->device->userInfos); $j<$userCount; $j++)
							<a>{{ $device_list[$i]->device->userInfos[$j]->name }}</a>
							@if($j < count($device_list[$i]->device->userInfos)-1)
								、
							@endif
						@endfor
						</td>
						<td>{{ $device_list[$i]->created_at }}</td>
					</tr>
					@endfor
				</tbody>
			</table>
@stop
@section('page_num')
<ul class="pagination pagination-lg"> 
@if(count($device_list))
	<?php
	$queryParam = [];
	$queryParam = empty($device_code)? $queryParam: array_merge($queryParam, ['device_code' => $device_code]);
	$queryParam = empty($status)? $queryParam: array_merge($queryParam, ['status' => $status]);
	$queryParam = empty($type_id)? $queryParam: array_merge($queryParam, ['type_id' => $type_id]);?>
	{!! $device_list->appends($queryParam)->render() !!}
@endif
</ul>
@stop
@section('infor_promit')
@parent
	<!-- 根据绑定用户获取用户信息 -->
	<div class="accountManageBg userInfo">
		<div class="accountManage" >
			<p class="titleTxt">用户资料</p>
			<div><span>用户姓名：</span><span class="userName spanWidth"></span></div>
			<div><span>手机号码：</span><span class="userPhone spanWidth"></span></div>
			<div><span>身份证号：</span><span class="IDNum spanWidth"></span></div>
			<div><span>安装地址：</span><span class="address spanWidth">fghsdklfgd;lkfjg;kdng;sdghk;地方刚开始的法国收到了方面的所发生的；李凤高没事了；放到</span></div>
			<div class="btnBox userInfBtn" style="margin:0 auto;margin-top: 100px; width: 135px;" >
				<a class="okBtn userInfOkBtn">确定</a>
			</div>
		</div>
	</div>

@stop


